﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Meebey.SmartIrc4net;

namespace IrcYo
{
    public class Opfer : IComparable
    {

        ChannelUser user;
        DateTime lastzeile;
        List<String> Zeilen;
        public String Nick
        {
            get { return user.Nick; }
        }

        public Opfer()
        {
            
        }

        public Opfer(ChannelUser user)
        {
            this.user = user; 
            Zeilen = new List<string>(); 
        }

        public void addZeile(String msg)
        {
            Zeilen.Add(msg); 
        }

        public override string ToString()
        {

            string ret;
            try
            {
                ret = user.Nick + "(" + Zeilen.Count + ")";

                foreach (String chan in user.JoinedChannels)
                    ret += " " + chan;
            }
            catch { return "error"; }
            return ret;  
        }
        public int CompareTo(object obj)
        {
            return Zeilen.Count.CompareTo(((Opfer)obj).Zeilen.Count); 
        } 
    }
}
